<include file="Public/header" title="提现列表" />
<div id="page-wrapper">
    <ol class="breadcrumb">
        <li class="breadcrumb-item">
          <a href="/admin.php">首页</a>
        </li>
        <li class="breadcrumb-item active">提现管理</li>
      </ol>
    <div class="row">
        <div class="col-lg-12">
            
        </div>
    </div>
    <div class="row">
        <div class="col-md-6">
           
        </div>
        <div class="col-md-6">
            <form action="{:U('Withdraw/index')}" method="post">
                <div class="form-group input-group">
                    <input type="text" class="form-control" name="key" placeholder="输入提现标题、作者或者分类关键词搜索">
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>
                    </span>
                </div>
            </form>
        </div>
    </div>
    <table class="table table-hover table-striped">
        <thead>
            <tr>
                <th>编号</th>
                <th>会员</th>
                <th>金额</th>
                <th>申请时间</th>
                <th>结束时间</th>
                <th>状态</th>
                <th>操作</th> 
            </tr>
        </thead>
        <tbody>
        <foreach name="model" item="v">
            <tr>
                <td>{$v.id}</td>
                <td>{$v.m_true_name}</td>
                <td>
                    {$v.sj_amount} (税 {$v.fax})
                </td>
                <td>{$v.add_time}</td>
                <td>{$v.end_time}</td>
                <td>{$v.status}</td>
                <td>
                <if condition='$v.staus eq "审核中"'>
                <a href="javascript:handle({$v.id})">操作</a> | 
                </if>
                <a href="{:U('Withdraw/delete?id=')}{$v.id}" style="color:red;" onclick="javascript:return del('您真的确定要删除吗？\n\n删除后将不能恢复!');">删除</a></td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="clearfix"></div>
    {$page}
    
</div>
<include file="Public/footer" />
<script>
   function handle(id){
       layer.confirm('请进行提现处理结果', {
              btn: ['已打款','打款失败', '取消'] //按钮
            }, function(){
              $.ajax({
                 url:"{:U('Withdraw/chg_status')}",
                 data:{"status":1, id:id},
                 type:"POST",
                 success:function(data){
                    if(data == 1){
                        layer.msg('操作成功!', function(){
                            location.reload();
                        });
                    }else{
                        layer.msg('操作失败，请稍后重试');
                    }
                 }
              })
            }, function(){
                $.ajax({
                 url:"{:U('Withdraw/chg_status')}",
                 data:{"status":2, id:id},
                 type:"POST",
                 success:function(data){
                    if(data == 1){
                        layer.msg('操作成功!', function(){
                            location.reload();
                        });
                    }else{
                        layer.msg('操作失败，请稍后重试');
                    }
                 }
              })
            });
   }
</script>